#include <REGX52.H>
#include <INTRINS.H>


void Delay20ms()		//@12.000MHz
{
	unsigned char i, j;

	i = 39;
	j = 230;
	do
	{
		while (--j);
	} while (--i);
}


void main()
{
	unsigned char LEDNum=0;
	while(1)
	{
		if(P3_1==0)
		{
			Delay20ms();
			while(P3_1==0);
			Delay20ms;
			LEDNum++;
			P2=~LEDNum;
		}
	
	}

	
}